<?php 
namespace Admin\Controller;
use Think\Controller;
class BaseController extends Controller{
	function _initialize(){
		if(!isset($_SESSION['username'])){
				$this->redirect("Admin/Login/index");
				exit();
		}

		$auth=new \Think\Auth();
		$rule_name=MODULE_NAME.'/'.CONTROLLER_NAME;
		$result=$auth->check($rule_name,$_SESSION['id']);
		if(!$result){
			$this->error('您没有访问权限',U('Admin/Index/index'));
		}
	}

}
